feat!: Add Electrum protocol v1.6 support - #18
Open
noahjoeris wants to merge 7 commits into
Open
Conversation
- Add `ServerVersion` request type (`server.version`) - Add optional `mode` parameter to `EstimateFee` (breaking: new field) - Support both pre-1.6 (concatenated hex) and v1.6 (list of hex strings) response formats for `blockchain.block.headers` - Add `BroadcastPackage` request type (`blockchain.transaction.broadcast_package`) - Add `GetMempoolInfo` request type (`mempool.get_info`) - Add missing `Features` to `gen_pending_request_types!` macro Closes bitcoindevkit#8 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Cover both the pre-1.6 concatenated-hex path and the v1.6 array-of-hex path, asserting they produce equal `Vec<Header>`, plus a sanity check that non-string/non-array inputs are rejected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Capture rejection details when package broadcast fails, and simplify broadcast hex encoding with serialize_hex.
mempool.get_info returns required BTC/kvB floats, so deserialize to FeeRate directly and share conversion with the estimatefee opt helper.
Use blockchain.relayfee in docs and switch the README sample to GetMempoolInfo for v1.6.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for Electrum protocol v1.6 methods and response format changes.
ServerVersionrequest type forserver.version(version negotiation)EstimateFeegains an optionalmodeparameter (EstimateFeeMode::{Economical, Conservative})blockchain.block.headersresponses support both pre-1.6 (concatenated hex"hex") and v1.6 (list of hex strings"headers") formatsBroadcastPackagerequest type forblockchain.transaction.broadcast_package(package relay)GetMempoolInforequest type formempool.get_info(replacesblockchain.relayfee)RelayFeeretained for pre-1.6 serversFeaturestogen_pending_request_types!macroGetMempoolInfoCloses #8
Supersedes #11
Notes to the reviewers